import { rolelist } from '../../../request/api';

interface sta {
    roleList: Array<any>
}

let state: sta = {
    roleList: [],
}

export default {
    namespaced: true,
    state,
    getters: {

    },
    mutations: {
        changeRoleList(state: any, data: any) {
            state.roleList = data;
        }
    },
    actions: {
        getRoleList({ commit }: any) {
            rolelist().then(((res: any) => {
                if (res.code == 200) {
                    let list = res.list ? res.list : [];
                    commit('changeRoleList', list);
                }
            }))
        }
    },
    modules: {
    }
}
